package com.tydic.watermark;

import com.alibaba.fastjson.JSONObject;

import java.io.Serializable;

public class KafkaEvent implements Serializable {

    private String xm;
    private int age;
    private String address;
    private String score;
    private long ctime;

    /**
     * pojo必须有一个空参数的构造函数，比如会报错
     */
    public KafkaEvent() {}

    public String getXm() {
        return xm;
    }

    public void setXm(String xm) {
        this.xm = xm;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getScore() {
        return score;
    }

    public void setScore(String score) {
        this.score = score;
    }

    public long getCtime() {
        return ctime;
    }

    public void setCtime(long ctime) {
        this.ctime = ctime;
    }

    public static KafkaEvent fromString(String eventStr) {
        return JSONObject.parseObject(eventStr, KafkaEvent.class);
    }

    @Override
    public String toString() {
        return JSONObject.toJSONString(this);
    }
}
